package com.tn.bo;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Embedded;
import javax.persistence.Id;
import javax.persistence.Transient;

import com.googlecode.objectify.annotation.Entity;


@Entity
public class POHeader {
	
	@Id
	private Long orderUniqueId;
	private String orderNumber;
	private String clientOrderNumber;
	private boolean status;
	private String orderTitle;
	private String orderSupplier;
	private Date orderDate;
	private Date orderSubmittedDate;
	private Date orderReceivedDate;
	private Double orderAmount;
	private String unitCurrencySymbol;
	private String orderCompany;
	@Embedded
	private Address orderBillToAddress;
	@Embedded
	private Address orderShipToAddress;
	private String orderDeliveryContact;
	private Date orderExpectedDate;
	private String orderStatus;
	private String orderRoutingStatus;
	private String orderPaymentTermId;
	private String orderContactPhone;
	private String orderContactEmail;
	private boolean  isCancel = false;
	private String poStatus;
	
	public String getPoStatus() {
		return poStatus;
	}
	public void setPoStatus(String poStatus) {
		this.poStatus = poStatus;
	}
	public boolean isCancel() {
		return isCancel;
	}
	public void setCancel(boolean isCancel) {
		this.isCancel = isCancel;
	}
	@Transient
	private String orderXml;
	
	
	public String getOrderXml() {
		return orderXml;
	}
	public void setOrderXml(String orderXml) {
		this.orderXml = orderXml;
	}
	public String getOrderContactPhone() {
		return orderContactPhone;
	}
	public void setOrderContactPhone(String orderContactPhone) {
		this.orderContactPhone = orderContactPhone;
	}
	public String getOrderContactEmail() {
		return orderContactEmail;
	}
	public void setOrderContactEmail(String orderContactEmail) {
		this.orderContactEmail = orderContactEmail;
	}
	public String getOrderPaymentTermId() {
		return orderPaymentTermId;
	}
	public void setOrderPaymentTermId(String orderPaymentTermId) {
		this.orderPaymentTermId = orderPaymentTermId;
	}
	private List<String> orderComments;
	private ArrayList<String> orderInvoices = new ArrayList<String>();
	private List<String> orderAttachmentsId;
	
	public List<String> getOrderAttachmentsId() {
		return orderAttachmentsId;
	}
	public void setOrderAttachmentsId(List<String> orderAttachmentsId) {
		this.orderAttachmentsId = orderAttachmentsId;
	}
	private String orderOwner;
	private String orderComposer;
	private Date lastModifiedDate;
	private String lastModifiedBy;
	private String prevVersionNumber;
	private String nextVersionNumber;
	private String versionNumber;
	private String changeOrderInitiatedBy;
	@Transient
	private List<POLineItem> orderLineItems;
	private Double taxAmount;
	private Double vatAmount;
	private String originatingSystem;
	private String originatingCompany;
	private Double invoicedAmount;
	private Double invoicedAcceptedAmount;
	private Double invoiceRejectedAmount;
	@Transient
	private List<Recipient> recipients;
	private String customField1;
	private String customField2;
	private String customField3;
	private String customField4;
	private String customField5;
	private String customField6;
	private String customField7;
	private String customField8;
	private String type;

	
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	@Transient
	private String clientNameText;
	@Embedded
	private Address supplierLocation;
	@Transient
	private List<POHeader> poHistory;
	
	
	
	public String getLastModifiedBy() {
		return lastModifiedBy;
	}
	public void setLastModifiedBy(String lastModifiedBy) {
		this.lastModifiedBy = lastModifiedBy;
	}
	public List<POHeader> getPoHistory() {
		return poHistory;
	}
	public void setPoHistory(List<POHeader> poHistory) {
		this.poHistory = poHistory;
	}
	public Address getSupplierLocation() {
		return supplierLocation;
	}
	public void setSupplierLocation(Address supplierLocation) {
		this.supplierLocation = supplierLocation;
	}
	public String getClientNameText() {
		return clientNameText;
	}
	public void setClientNameText(String clientNameText) {
		this.clientNameText = clientNameText;
	}
	public Long getOrderUniqueId() {
		return orderUniqueId;
	}
	public void setOrderUniqueId(Long orderUniqueId) {
		this.orderUniqueId = orderUniqueId;
	}
	public String getOrderNumber() {
		return orderNumber;
	}
	public void setOrderNumber(String orderNumber) {
		this.orderNumber = orderNumber;
	}
	public String getClientOrderNumber() {
		return clientOrderNumber;
	}
	public void setClientOrderNumber(String clientOrderNumber) {
		this.clientOrderNumber = clientOrderNumber;
	}
	public boolean isStatus() {
		return status;
	}
	public void setStatus(boolean status) {
		this.status = status;
	}
	public String getOrderTitle() {
		return orderTitle;
	}
	public void setOrderTitle(String orderTitle) {
		this.orderTitle = orderTitle;
	}
	public String getOrderSupplier() {
		return orderSupplier;
	}
	public void setOrderSupplier(String orderSupplier) {
		this.orderSupplier = orderSupplier;
	}
	public Date getOrderDate() {
		return orderDate;
	}
	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}
	public Date getOrderSubmittedDate() {
		return orderSubmittedDate;
	}
	public void setOrderSubmittedDate(Date orderSubmittedDate) {
		this.orderSubmittedDate = orderSubmittedDate;
	}
	public Date getOrderReceivedDate() {
		return orderReceivedDate;
	}
	public void setOrderReceivedDate(Date orderReceivedDate) {
		this.orderReceivedDate = orderReceivedDate;
	}
	public Double getOrderAmount() {
		return orderAmount;
	}
	public void setOrderAmount(Double orderAmount) {
		this.orderAmount = orderAmount;
	}
	
	public String getUnitCurrencySymbol() {
		return unitCurrencySymbol;
	}
	public void setUnitCurrencySymbol(String unitCurrencySymbol) {
		this.unitCurrencySymbol = unitCurrencySymbol;
	}
	public String getOrderCompany() {
		return orderCompany;
	}
	public void setOrderCompany(String orderCompany) {
		this.orderCompany = orderCompany;
	}
	public Address getOrderBillToAddress() {
		return orderBillToAddress;
	}
	public void setOrderBillToAddress(Address orderBillToAddress) {
		this.orderBillToAddress = orderBillToAddress;
	}
	public Address getOrderShipToAddress() {
		return orderShipToAddress;
	}
	public void setOrderShipToAddress(Address orderShipToAddress) {
		this.orderShipToAddress = orderShipToAddress;
	}
	public String getOrderDeliveryContact() {
		return orderDeliveryContact;
	}
	public void setOrderDeliveryContact(String orderDeliveryContact) {
		this.orderDeliveryContact = orderDeliveryContact;
	}
	public Date getOrderExpectedDate() {
		return orderExpectedDate;
	}
	public void setOrderExpectedDate(Date orderExpectedDate) {
		this.orderExpectedDate = orderExpectedDate;
	}
	public String getOrderStatus() {
		return orderStatus;
	}
	public void setOrderStatus(String orderStatus) {
		this.orderStatus = orderStatus;
	}
	public String getOrderRoutingStatus() {
		return orderRoutingStatus;
	}
	public void setOrderRoutingStatus(String orderRoutingStatus) {
		this.orderRoutingStatus = orderRoutingStatus;
	}
	
	public List<String> getOrderComments() {
		return orderComments;
	}
	public void setOrderComments(List<String> orderComments) {
		this.orderComments = orderComments;
	}
	public ArrayList<String> getOrderInvoices() {
		return orderInvoices;
	}
	public void setOrderInvoices(ArrayList<String> orderInvoices) {
		this.orderInvoices = orderInvoices;
	}
	
	public String getOrderOwner() {
		return orderOwner;
	}
	public void setOrderOwner(String orderOwner) {
		this.orderOwner = orderOwner;
	}
	public String getOrderComposer() {
		return orderComposer;
	}
	public void setOrderComposer(String orderComposer) {
		this.orderComposer = orderComposer;
	}
	public Date getLastModifiedDate() {
		return lastModifiedDate;
	}
	public void setLastModifiedDate(Date lastModifiedDate) {
		this.lastModifiedDate = lastModifiedDate;
	}
	public String getPrevVersionNumber() {
		return prevVersionNumber;
	}
	public void setPrevVersionNumber(String prevVersionNumber) {
		this.prevVersionNumber = prevVersionNumber;
	}
	public String getNextVersionNumber() {
		return nextVersionNumber;
	}
	public void setNextVersionNumber(String nextVersionNumber) {
		this.nextVersionNumber = nextVersionNumber;
	}
	public String getVersionNumber() {
		return versionNumber;
	}
	public void setVersionNumber(String versionNumber) {
		this.versionNumber = versionNumber;
	}
	public String getChangeOrderInitiatedBy() {
		return changeOrderInitiatedBy;
	}
	public void setChangeOrderInitiatedBy(String changeOrderInitiatedBy) {
		this.changeOrderInitiatedBy = changeOrderInitiatedBy;
	}
	public List<POLineItem> getOrderLineItems() {
		return orderLineItems;
	}
	public void setOrderLineItems(List<POLineItem> orderLineItems) {
		this.orderLineItems = orderLineItems;
	}
	public Double getTaxAmount() {
		return taxAmount;
	}
	public void setTaxAmount(Double taxAmount) {
		this.taxAmount = taxAmount;
	}
	public Double getVatAmount() {
		return vatAmount;
	}
	public void setVatAmount(Double vatAmount) {
		this.vatAmount = vatAmount;
	}
	public String getOriginatingSystem() {
		return originatingSystem;
	}
	public void setOriginatingSystem(String originatingSystem) {
		this.originatingSystem = originatingSystem;
	}
	public String getOriginatingCompany() {
		return originatingCompany;
	}
	public void setOriginatingCompany(String originatingCompany) {
		this.originatingCompany = originatingCompany;
	}
	public Double getInvoicedAmount() {
		return invoicedAmount;
	}
	public void setInvoicedAmount(Double invoicedAmount) {
		this.invoicedAmount = invoicedAmount;
	}
	public Double getInvoicedAcceptedAmount() {
		return invoicedAcceptedAmount;
	}
	public void setInvoicedAcceptedAmount(Double invoicedAcceptedAmount) {
		this.invoicedAcceptedAmount = invoicedAcceptedAmount;
	}
	public Double getInvoiceRejectedAmount() {
		return invoiceRejectedAmount;
	}
	public void setInvoiceRejectedAmount(Double invoiceRejectedAmount) {
		this.invoiceRejectedAmount = invoiceRejectedAmount;
	}
	public List<Recipient> getRecipients() {
		return recipients;
	}
	public void setRecipients(List<Recipient> recipients) {
		this.recipients = recipients;
	}
	public String getCustomField1() {
		return customField1;
	}
	public void setCustomField1(String customField1) {
		this.customField1 = customField1;
	}
	public String getCustomField2() {
		return customField2;
	}
	public void setCustomField2(String customField2) {
		this.customField2 = customField2;
	}
	public String getCustomField3() {
		return customField3;
	}
	public void setCustomField3(String customField3) {
		this.customField3 = customField3;
	}
	public String getCustomField4() {
		return customField4;
	}
	public void setCustomField4(String customField4) {
		this.customField4 = customField4;
	}
	public String getCustomField5() {
		return customField5;
	}
	public void setCustomField5(String customField5) {
		this.customField5 = customField5;
	}
	public String getCustomField6() {
		return customField6;
	}
	public void setCustomField6(String customField6) {
		this.customField6 = customField6;
	}
	public String getCustomField7() {
		return customField7;
	}
	public void setCustomField7(String customField7) {
		this.customField7 = customField7;
	}
	public String getCustomField8() {
		return customField8;
	}
	public void setCustomField8(String customField8) {
		this.customField8 = customField8;
	}
	
	public String toString(){
		return "orderNumber: " + orderNumber + ", orderCompany: " + orderCompany + ", clientOrderNumber: " + clientOrderNumber + ", status: " + status + ", orderTitle: " + orderTitle;
	}
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof POHeader){
			return this.getOrderNumber().equals(((POHeader)obj).getOrderNumber());
		}
		return false;
	}
	
	
	
	
	
	
	

}
